package edu.zut.cs.software.module.goodsShelf.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import edu.zut.cs.software.teach.Base.domain.BaseTreeEntity;

/**
 * 
 * @author WuZhiXin
 * 
 *
 */

@Entity
@Table(name = "T_GoodsCategory")
@NamedQueries({ @NamedQuery(name = "GoodsCategory.getRoot", query = "select m from GoodsCategory m where m.parent is null") })
public class GoodsCategory extends BaseTreeEntity<GoodsCategory, Long> {

	/*
	 * This is information about the item class
	 */
	private static final long serialVersionUID = -2411978175041541798L;

	/*
	 * The name of the goods
	 */
	@Column
	String name;

	/*
	 * The number of goods
	 */
	@Column
	int count;
	@OneToMany(mappedBy = "goodsCategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<GoodsShelf> goosshelf;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
